package cn.serein.charging.cost.dao.repository.impl;

import cn.serein.charging.cost.dao.mapper.ChargingRuleMapper;
import cn.serein.charging.cost.dao.repository.ChargingRuleRepository;
import cn.serein.charging.cost.pojo.po.CostRulePO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


import java.util.List;


@Repository
public class ChargingRuleRepositoryImpl implements ChargingRuleRepository {

    @Autowired
    private ChargingRuleMapper chargingRuleMapper;

    // 在这里面实现与数据的交互
    @Override
    public List<CostRulePO> getCostRules(Integer stationId) {
        // mybatis plus的写法
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("station_id",stationId);


        return chargingRuleMapper.selectList(queryWrapper);
    }
}
